public class CallByValueReference
{
	public static void main(String[] args)	{
		// Test for Call by Value
		int x = 5;
		changeValue(x);
		System.out.println("Outside Function: x = " + x);
		
		// Test for Call by Reference
		int[] a = {5};
		changeReference(a);
		System.out.println("Outside Function: a[0] = " + a[0]);
	}

	public static void changeValue(int x)
	{
		x++;
		System.out.println("Inside Function: x = " + x);
	}
	
	public static void changeReference(int[] a)
	{
		a[0] += 1;
		System.out.println("Inside Function: a[0] = " + a[0]);
	}
}
